using System;

using TrueCode.Core.Aspects;


namespace TrueCode.DependencyManager.Extensions.Action
{
  public static class ActionExtensions
  {
    public static Container AddDefaultAction( [NotNull] this Container container, [NotNull] object buildStep,
                                              [NotNull] IBuildAction action )
    {
      if( container == null ) throw new ArgumentNullException( "container" );

      container.Actions.AddDefault( buildStep, action );
      return container;
    }

    public static Container Add( this Container container, [NotNull] object buildStep, [NotNull] SessionAim aim,
                                 [NotNull] IBuildAction action )
    {
      if( container == null ) throw new ArgumentNullException( "container" );

      container.Actions.Add( buildStep, aim, action );
      return container;
    }

    public static IBuildAction Get( this Container container, [NotNull] object buildStep, [NotNull] SessionAim aim )
    {
      return container.Actions.Get( buildStep, aim );
    }
  }
}